package com.video.controller;

import com.common.domain.po.LikedRecord;
import com.common.result.Result;
import com.video.service.VideoItemService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 路亚
 * @version 0.1
 * @className VideoItemController
 * @description
 * @date 2024/12/26 10:52
 * @since jdk11
 */
@RestController
@RequestMapping("/video/item")
@RequiredArgsConstructor
@Slf4j
@Api(tags = "视频行管理")
public class VideoItemController {

    private final VideoItemService videoItemService;

    @PostMapping("/playBack")
    @ApiOperation("播放视频")
    public Result playBack(Long id) {
        videoItemService.playBack(id);
        return Result.success();
    }

    @GetMapping("/queryByVideoItemId")
    public LikedRecord queryByVideoItemId(Long id) {
        return videoItemService.queryByVideoItemId(id);
    }
}
